# -*- coding:utf-8 -*-
# @Time:2024/4/1921:01
# @Author:miuzg
# @FileName:new test2.py
# @Software:PyCharm
from selenium import webdriver
from selenium.webdriver.edge.options import Options as EdgeOptions
from selenium.webdriver.common.by import By



# 无界面模式，设置(selenium版本太旧会出现没有add_argument的问题
options = EdgeOptions()

options.add_argument('--headless')

driver = webdriver.Edge(options = options)

url = 'https://www.mi.com/shop'

driver.get(url)

driver.maximize_window()

a_list = driver.find_elements(By.XPATH,'//li[@class="brick-item brick-item-m brick-item-m-2"]//a')

for a in a_list:
    print(a.text)
    print()

driver.quit()